//
//  YCRouter.swift
//  WeiboDemo
//
//  Created by 尹成 on 2017/1/6.
//  Copyright © 2017年 yc. All rights reserved.
//

import UIKit

class YCRouter: NSObject {
    
    class func jump(from:UIViewController,to:String) -> () {
        
        
        
        
        let allNameString = Bundle.main.spaceName + "." + to
        
        guard let cls = NSClassFromString(allNameString) as? UIViewController.Type,
            let vc:UIViewController = cls.init() else {
                return
        }
        
        from.navigationController?.pushViewController(vc, animated: true)
    }
    
    class func jump(from:UIViewController,to:String,with:Any) -> () {
        let allNameString = Bundle.main.spaceName + "." + to
        
        guard let cls = NSClassFromString(allNameString) as? UIViewController.Type,
            let vc:UIViewController = cls.init() else {
                return
        }
        vc.setValue(with, forKey: "Dict")
        from.navigationController?.pushViewController(vc, animated: true)
        
    }
}
